package com.gyg.client;

import com.gyg.returns.RespEntity;
import com.gyg.vo.param.DownloadParam;
import com.gyg.vo.param.FileParam;
import com.gyg.vo.param.UpdateFileParam;
import com.gyg.vo.result.FileDownloadResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloudDocumentClient", url = "${cloud.box.url}")
public interface CloudDocumentClient {

    /**
     * 文档数据上传
     * @param fileParam
     * @return
     */
    @PostMapping("/cloud-document/upload")
    RespEntity uploadDocument(@RequestBody FileParam fileParam);

    /**
     * 文档列表数据
     * @param userId
     * @param pageNum
     * @param pageSize
     * @param content
     * @return
     */
    @GetMapping("/cloud-document/list")
    RespEntity cloudDocumentList(@RequestParam(value = "userId", required = true) Integer userId,
                                 @RequestParam(value = "pageNum", required = true) Integer pageNum,
                                 @RequestParam(value = "pageSize", required = true) Integer pageSize,
                                 @RequestParam(value = "content", required = false) String content);

    /**
     * 编辑文档
     * @param updateFileParam
     * @return
     */
    @PutMapping("/cloud-document/update")
    RespEntity updateDocument(@RequestBody UpdateFileParam updateFileParam);

    /**
     * 删除文档
     * @param documentId
     * @return
     */
    @DeleteMapping("/cloud-document/delete")
    RespEntity deleteDocument(@RequestParam(value = "documentId", required = true) Integer documentId);

    /**
     * 文档云盘信息
     * @param userId
     * @return
     */
    @GetMapping("/cloud-document/info")
    RespEntity documentCloudInfo(@RequestParam(value = "userId", required = true) Integer userId);

    /**
     * 文档下载
     * @param downloadParam
     * @return
     */
    @PostMapping("/cloud-document/download")
    RespEntity<FileDownloadResult> download(@RequestBody DownloadParam downloadParam);
}
